#ifndef EtPeManager_First
#define EtPeManager_First
#ifdef __GNUG__
#pragma interface
#endif

#include "Dialog.h"
#include "ByteArray.h"
#include "Window.h"

class VObject;
class PeHierarchyBrowser;
class PeObjectBrowser;
class PeInspector;
class PeSourceBrowser;
class PeFihTool;
class Window;
class PathLookup;
class PeMethodAccessor;
class Collection;
class Ref;
class Menu;

//---- EtPeManager -------------------------------------------------------------

class EtPeManager: public Dialog {
	static PathLookup *universe;

	PeMethodAccessor *methodAccessor;

public:
	MetaDef(EtPeManager);
	EtPeManager();
	~EtPeManager();

	VObject *DoMakeContent();
	VObject *DoMakeIconContent();

	void Control(int id, int part, void *val);

	void SrcBrowserShow(Class *cp, bool decl, int at= -1);
	void SrcBrowserSpawn(Class *cp, bool decl, int at= -1);

	//---- universe of source files
	static PathLookup *Universe();
	static bool FileOfClass(Class *cl, char *fname, bool decl);

	//---- method access
	bool SameMethods(const char *m1, const char *m2);
	Collection *LoadMethodsOfClass(Class *cl);
	bool IsDestructor(const char *m1);

	void CollectParts(Collection* col);

	//---- menues
	Command *DoMenuCommand(int);
};

//---- MethodReference ---------------------------------------------------------

class PeMethodReference: public ByteArray {
	Class *clp;
	int line;
	bool isPublic;
public:
	MetaDef(PeMethodReference);
	PeMethodReference(int line, Class *clp, const char *method, bool isPublic);
	bool IsEqual(Object *);
	int Line()
		{ return line; }
	Class *GetClass()
		{ return clp; }
	bool IsPublic()
		{ return isPublic; }
};

//---- entry points ------------------------------------------------------------

extern EtPeManager *gEtPeManager;

#endif
